package com.shopping_back.mapper;

import com.shopping_back.pojo.entity.OrderItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shopping_back.pojo.entity.OrderMain;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 订单商品项表 Mapper 接口
 * </p>
 *
 * @author Jack
 * @since 2025-07-12
 */
@Mapper
public interface OrderItemMapper extends BaseMapper<OrderItem> {

    List<OrderItem> selectByOrderId(@RequestParam("orderId") Long id);

    List<OrderMain> selectOrdersByActivityId(Long activityId);

    Integer selectSumQuantityByUserAndActivity(Long userId, Long activityId, Long skuId);
}
